package top.zk123.chain.service;

import org.springframework.web.multipart.MultipartFile;
import top.zk123.chain.bean.ReturnInfo;
import top.zk123.chain.bean.Verify;
import top.zk123.chain.exception.FileEmptyException;
import top.zk123.chain.exception.FileUploadException;
import top.zk123.chain.exception.WrongFileTypeException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 验证相关 业务逻辑层
 *
 * @author Ke Zhang
 * @since 2.0
 */
public interface VerifyService {
    /**
     * 验证证书
     *
     * @param files 证书 JSON 文件
     * @return ReturnInfo
     */
    ReturnInfo verifyCerts(MultipartFile[] files) throws FileEmptyException, WrongFileTypeException, FileUploadException;

    /**
     * 获取证书详细信息
     *
     * @param UId 证书 UId
     * @return ReturnInfo
     */
    ReturnInfo getCertDetail(String UId);

    /**
     * 导出Excel
     *
     * @param request
     * @param response
     * @param dataList
     */
    void exportExcel(HttpServletRequest request, HttpServletResponse response, List<Verify> dataList);

    /**
     * 导出选中的记录
     *
     * @param request
     * @param response
     * @param UIdList
     * @return
     */
    ReturnInfo exportExcelSelected(HttpServletRequest request, HttpServletResponse response, List<String> UIdList);

    /**
     * 导出全部的记录
     *
     * @param request
     * @param response
     * @return
     */
    ReturnInfo exportExcelAll(HttpServletRequest request, HttpServletResponse response);
}
